home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / vbasic / 256vbcol / 256picbx.bas next >
BASIC Source File  |  1992-03-16  |  3KB  |  82 lines

  1. ' Useful constants
  2. Global Const NULL = 0
  3. Global Const TRUE = -1
  4. Global Const FALSE = 0
  5.  
  6. ' Cursor values
  7. Global Const Default = 0    ' 0 - Default
  8. Global Const ARROW = 1      ' 1 - Arrow
  9. Global Const HOURGLASS = 11 ' 11 - Hourglass
  10.  
  11. 'Declare DIB utility routines
  12. Declare Function FindDIBBits Lib "DIBUTIL" (ByVal lpbi&) As Long
  13. Declare Function DibNumColors Lib "DIBUTIL" (ByVal lpbi&) As Integer
  14. Declare Function PaletteSize Lib "DIBUTIL" (ByVal lpbi&) As Integer
  15. Declare Function CreateDIBPalette Lib "DIBUTIL" (ByVal hDIB%) As Integer 'HPAL
  16. Declare Function DIBHeight Lib "DIBUTIL" (ByVal lpDIB&) As Long
  17. Declare Function DIBWidth Lib "DIBUTIL" (ByVal lpDIB&) As Long
  18. Declare Function DIBLoad Lib "DIBUTIL" (ByVal lpszDIBName$) As Integer   'hDIBInfo
  19.  
  20. ' Win API Constants, type declarations, etc.
  21.  
  22. 'Menu manipulation constants
  23. Global Const MF_BYCOMMAND = &H0
  24. Global Const MF_BYPOSITION = &H400
  25.  
  26. ' The only Raster Op code we need
  27. Global Const SRCCOPY = &HCC0020
  28.  
  29. ' CreatDIBitmap init param
  30. Global Const CBM_INIT = &H4
  31.  
  32. 'A Bitmap file Header
  33. Type BitmapFileHeader
  34.     bftype As Integer
  35.     bfsize As Long
  36.     bfReserved1 As Integer
  37.     bfReserved2 As Integer
  38.     bfOffBits As Long
  39. End Type
  40.  
  41. 'A Win 3.x Bitmap file information header
  42. Type BitmapInfoHeader
  43.     biSize As Long
  44.     biWidth As Long
  45.     biHeight As Long
  46.     biPlanes As Integer
  47.     biBitCount As Integer
  48.     biCompression As Long
  49.     biSizeImage As Long
  50.     biXPelsPerMeter As Long
  51.     biYPelsPerMeter As Long
  52.     biClrUsed As Long
  53.     biClrImportant As Long
  54. End Type
  55.  
  56. ' Windows API declarations
  57.  
  58. ' Memory functions
  59. Declare Function GlobalFree Lib "Kernel" (ByVal hMem%) As Integer
  60. Declare Function GlobalLock Lib "Kernel" (ByVal hMem%) As Long
  61. Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem%) As Integer
  62.  
  63. ' GDI functions
  64. Declare Function CreateCompatibleDC Lib "GDI" (ByVal hDC%) As Integer
  65. Declare Function SelectObject Lib "GDI" (ByVal hDC%, ByVal hObject%) As Integer
  66. Declare Function BitBlt Lib "GDI" (ByVal hDestDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal dwRop&) As Integer
  67. Declare Function DeleteDC Lib "gdi" (ByVal hDC%) As Integer
  68. Declare Function SelectPalette Lib "USER" (ByVal hDC As Integer, ByVal hPalette As Integer, ByVal bForceBackground As Integer) As Integer
  69. Declare Function RealizePalette Lib "USER" (ByVal hDC As Integer) As Integer
  70. Declare Function CreateDIBitmap Lib "GDI" (ByVal hDC As Integer, ByVal lpInfoHeader As Long, ByVal dwUsage As Long, ByVal lpInitBits As Long, ByVal lpInitInfo As Long, ByVal wUsage As Integer) As Integer
  71. Declare Function DeleteObject Lib "GDI" (ByVal hGDIObject%) As Integer
  72. Declare Function GetDC Lib "USER" (ByVal hWnd As Integer) As Integer
  73. Declare Function ReleaseDC Lib "USER" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
  74.  
  75. ' Miscellany
  76. Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer
  77. Declare Function GetSystemMenu Lib "User" (ByVal Handle%, ByVal bRevert%) As Integer
  78. Declare Function RemoveMenu Lib "User" (ByVal hMenu%, ByVal Position%, ByVal Flags%) As Integer
  79. Declare Function LoadLibrary Lib "Kernel" (ByVal lpszFileName$) As Integer
  80. Declare Sub FreeLibrary Lib "Kernel" (ByVal hModule%)
  81.  
  82.